<?php
/**
 * Created by PhpStorm.
 * User: Mr.liu
 * Date: 2021/12/17
 * Time: 11:16
 * Motto: 今日事，今日毕
 */
include_once '../tools/DbTools.php';
session_start();

include_once '../common/common.php';
$isLogin = getLoginStatus();
if(!$isLogin){
    echo '尚未登入，<a href="../user/loginUi.php">请先登入</a>';die;
}


DbTools::init();

if(isset($_POST['check']) &&$_POST['check']!=null){


for($i=0;$i<count($_POST['check']);$i++){
    $cardNo=$_POST['check'][$i];
    $result=changeState($cardNo);

}
if($result['status']){
    echo '销卡成功<a href="registration.php">继续</a>';
}else{
    echo '销卡有误： '.$result['message'];
}

}
DbTools::close();